package cqrtplm.controller;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.ty.basic.response.ResponseResult;
import com.ty.basic.service.snow.SnowflakeIdComponent;
import cqrtplm.constant.RouteConstant;
import cqrtplm.dto.RtTestRequirementsDTO;
import cqrtplm.entity.RtTestRequirementsDO;
import cqrtplm.mapper.RtTestRequirementsMapper;
import cqrtplm.service.RtTestRequirementsService;
import cqrtplm.vo.StatusInfoDetailContentVO;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.math.BigInteger;
import java.util.Date;
import java.util.List;

@RestController
@RequestMapping(RouteConstant.DEMANDMANAGEMENT + "v1")
@Api(tags = "需求管理")
public class RtTestRequirementsController {

    @Resource
    private RtTestRequirementsService  rtTestRequirementsService;



    @PostMapping("/getRtTestRequirementsDOAll")
    public PageInfo<RtTestRequirementsDO> getRtTestRequirementsDOAll(
            @RequestBody RtTestRequirementsDTO queryDTO) {

        return rtTestRequirementsService.selectAllByRtTestRequirementsDTO(queryDTO, queryDTO.getPageNum()==null ? 1: queryDTO.getPageNum(), queryDTO.getPageSize()==null ? 10: queryDTO.getPageSize());
    }

    @PostMapping("/deleteByOids")
    public ResponseResult deleteRtTestRequirementsDOByOid( @RequestBody String[] oids){
        return rtTestRequirementsService.deleteRtTestRequirementsDOByOid(oids);
    }

    @PostMapping("/createRtTestRequirementsDO")
    public ResponseResult createRtTestRequirementsDO(@RequestBody RtTestRequirementsDTO dto){
        return rtTestRequirementsService.createRtTestRequirementsDO(dto);
    }
    @PostMapping("/updateRtTestRequirementsDO")
    public ResponseResult updateRtTestRequirementsDO(@RequestBody RtTestRequirementsDTO dto){
        return rtTestRequirementsService.updateRtTestRequirementsDO(dto);
    }

    @GetMapping("/queryStatusInfoByTestCode")
    public ResponseResult queryStatusInfoByTestCode(@RequestParam String testCode){
        return rtTestRequirementsService.queryStatusInfoByTestCode(testCode);
    }

}
